package org.third.security.crypto;


import java.io.File;
import java.security.NoSuchAlgorithmException;
import java.security.NoSuchProviderException;
import java.util.logging.Level;
import java.util.logging.Logger;

public class CryptoTest {
    public static void main(String[] args) throws NoSuchAlgorithmException, NoSuchProviderException {
        File f = new File("file:/c:/asdf.txt");
        System.out.println(f.getAbsolutePath());
        System.out.println(f.getName());
        System.out.println(f.getPath());
        System.out.println(f.isAbsolute());
        
        
        Logger rootLogger = Logger.getGlobal();
        rootLogger.setLevel(Level.ALL);
        String t2 = SecurityHelper.decrypt("ENC(dbfQzpUVUQYwjYIxM+3PwndkEJ/aEra2Ow3Ao0NRUrFQ+iisbYXVfZjg/oG+L4AibbGcDG5KU6j5IwiZCHBPAg==)");
        System.out.println(t2);
        Logger logger = Logger.getLogger(CryptoTest.class.getName());
        logger.fine("find");
        // SSLContext sslContext = SSLContext.getInstance("TLS");
        // System.out.println(sslContext.getProvider().getInfo());

        // provider-user.properties
        // admin=ENC(c1O5WcI/Oy4kvkWMvm8jNDNTPKCPo1GkF3Cnh03ZPxir3sX1GlNlOFnm2qw7kPG0bLuZTnXVxQrmqC4q36x4mrplyv5cffJNizwZjipEf/PD4NP5a7Snqw3kRMK61LNARkxYvZT1stzlOr+Heh9shw==)
        // sxCatalogTransportUser=ENC(tNpqyVzAV4MlazXp9xBQRfPMHvY0NswxoMdRPIb+18+dZfWpIBWL7ER1nvF4RIwKbZSUpSXM9UnZCJJgedwRFIy7QiLFiCHo)
        // searchTransportUser=ENC(r17P8AkbhEPjNovLZxbaXkKIPc77ER2m1rnOrG4gRvQ9LegKUsExe9jGu6go5cp8)
        // idm.admin=ENC(dAL9nbwGfRUK7AfqETjhc3N5HbJvEptTRymdvx63pUAcoSlInezv0g==)

        // String text1="cloud";
        // String EncryptedText1="cloud";
        //
        // String text2="cloud";
        // String EncryptedText2="cloud";
        //
        // System.out.println(com.hp.ccue.crypto.util.SecurityHelper.decrypt(null));
        // System.out.println("crypto:"+(EncryptedText1=com.hp.ccue.crypto.util.SecurityHelper.encrypt(text1)));
        // System.out.println("crypto:"+(com.hp.ccue.crypto.util.SecurityHelper.decrypt("ENC("+EncryptedText1)+")"));
        // System.out.println("decrypt:"+
        // com.hp.ccue.crypto.util.SecurityHelper.decrypt("ENC(REtzeMhhAKGpZi7pFkdN8G89E2XcY6z8dmY5n5RodOw=)"));
        // System.out.println(EncryptedText2=com.hpe.shared.dataprotection.SecurityHelper.getSharedEnc().encryptString(text2));
        // System.out.println(EncryptedText2=com.hpe.shared.dataprotection.SecurityHelper.getSharedEnc().encryptStringNullPass(text2));
        // System.out.println(EncryptedText2=com.hpe.shared.dataprotection.SecurityHelper.getSharedEnc().encryptWithMarker(text2));
        //
        // System.out.println(com.hpe.shared.dataprotection.SecurityHelper.getSharedEnc().decryptWithMarker(EncryptedText2));
        //
        // System.out.println(com.hpe.shared.dataprotection.SecurityHelper.getSharedEnc().decryptWithMarker(EncryptedText2));
        // System.out.println(com.hp.ccue.crypto.util.SecurityHelper.decrypt(EncryptedText2));
        // System.out.println(com.hpe.shared.dataprotection.SecurityHelper.getSharedEnc().decryptStringNullPass(EncryptedText2));

        // String plaintext = "a";
        // MessageDigest md = MessageDigest.getInstance("SHA-256");
        // MessageDigest md = MessageDigest.getInstance("SHA-1");
        // MessageDigest md = MessageDigest.getInstance("PBKDF2");
        //
        // byte[] message = plaintext.getBytes();
        // md.update(message);
        // byte[] digest = md.digest();

        // Sy?stem.out.println("length=" + digest.length + "," + Base64.encodeBase64String(digest));
        // admin=ENC(c1O5WcI/Oy4kvkWMvm8jNDNTPKCPo1GkF3Cnh03ZPxir3sX1GlNlOFnm2qw7kPG0bLuZTnXVxQrmqC4q36x4mrplyv5cffJNizwZjipEf/PD4NP5a7Snqw3kRMK61LNARkxYvZT1stzlOr+Heh9shw==)
        // sxCatalogTransportUser=ENC(tNpqyVzAV4MlazXp9xBQRfPMHvY0NswxoMdRPIb+18+dZfWpIBWL7ER1nvF4RIwKbZSUpSXM9UnZCJJgedwRFIy7QiLFiCHo)
        // searchTransportUser=ENC(r17P8AkbhEPjNovLZxbaXkKIPc77ER2m1rnOrG4gRvQ9LegKUsExe9jGu6go5cp8)
        // idm.admin=ENC(dAL9nbwGfRUK7AfqETjhc3N5HbJvEptTRymdvx63pUAcoSlInezv0g==)

        // admin=propel,DIAGNOSTICS_ADMIN,SUPPLIER_VIEWER,CONTENT_ADMIN,LICENSE_ADMIN,SUPER_IDM_ADMIN,ROLE_REST,enabled
        // sxCatalogTransportUser=sxCatalogTransportUser,INTEGRATOR,SUPER_IDM_ADMIN,enabled
        // searchTransportUser=searchTransportUser,SEARCH,enabled
        // idm.admin=cloud,SUPER_IDM_ADMIN,enabled
        // System.out.println(SecurityHelper.decrypt("9rn23PgQSK1dnGIgWXiI+RuELw+SsbuJJ77MjGxXnQhgRPZxhkoPI/WEWTOZ9V1HaYljY5t8gKfSlfU4oocboNSUcvQ44OATkjQ+ymgyOYEFSZoWtHifD8r6C8+hcvSy1oXhrPo2keP02u1Oti7m87flk3M2mj1JHSIKLrbYJGk="));

    }
}
